A conventional database system uses a datastore to persistently store data pages, and a cache to provide fast access to the data pages. For example, in response to a request to access a data page, the data page is loaded from the datastore into the cache, and may thereafter be accessed from and/or modified within the cache. At specified times (e.g., when the data stored in the cache reaches a particular percentage of the total cache capacity, when a savepoint is initiated, etc.), modified data pages from the cache are written back to the datastore.
A “shadow paging” system may be employed, in which the original unmodified data page remains designated as a “last known good” page in the datastore and the modified data page is written to a new location in the datastore. The datastore also includes converter pages, which map the logical page number of a data page to the location of the datastore at which the “last known good” data page is stored. The converter pages are also loaded into the cache, and are modified within the cache once a modified data page is saved to a new location of the datastore. The modified converter pages are written to the datastore at the end of a savepoint, after all modified data pages are written, and are written to locations which are different from the locations of the last version of the converter pages.
When a data page or a converter page is created in the cache, a control block for the page is also allocated within the cache. The control block may include various information used for cache management, such as the page number of the page, a read/write lock for the contents of the page, a flag indicating whether or not the page has been modified from its “last known good” version, Least Recently Used (LRU) information used to implement page replacement policies for freeing cache space, etc.
Optimizations have been developed for managing different types of pages (e.g., converter, data) within a database cache. Conventional page control blocks do not provide the data structures required to implement these optimizations. Accordingly, these data structures must be separately allocated and managed.